//
//  UIView+Nib.swift
//  Extend
//
//  Created by 元穗 on 2017/6/2.
//  Copyright © 2017年 敬信. All rights reserved.
//

import UIKit

// MARK: UIView快捷加载xib

protocol NibLoadable {
}

extension NibLoadable where Self: UIView {
    static func loadNib(_ nibName: String? = nil) -> Self {
        return Bundle.main.loadNibNamed(nibName ?? "\(self)", owner: nil, options: nil)?.first as! Self;
    }
}

extension UIView: NibLoadable {
}
